//
//  HRButton.m
//  haierapp
//
//  Created by Zhou Bing on 14-8-14.
//  Copyright (c) 2014年 haier. All rights reserved.
//

#import "HRButton.h"

@implementation HRButton
- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code
        [self settingView];
    }
    return self;
}

- (void)awakeFromNib
{
    [self settingView];
}

- (void)settingView
{
    // 加圆角
    self.layer.cornerRadius = 5;
    self.layer.masksToBounds = YES;
    
    // 设置统一颜色
    [self setBackgroundColor:[UIColor clearColor]];
    [self setBackgroundImage:[UIImage createImageWithColor:[UIColor colorFromHexRGB:@"ff8730"]] forState:UIControlStateNormal];
//    [self setBackgroundImage:[UIImage createImageWithColor:@""] forState:UIControlStateDisabled];
    
    // 设置统一字体颜色
    [self setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [self setTitleColor:[UIColor lightGrayColor] forState:UIControlStateHighlighted];
    [self setTitleColor:[[UIColor whiteColor] colorWithAlphaComponent:0.8] forState:UIControlStateDisabled];
    
    //    [self setTitleColor:[UIColor colorFromHexRGB:@"a8a8a8"] forState:UIControlStateDisabled];
}

@end
